/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rw.magallanes.core;

import com.thoughtworks.xstream.annotations.XStreamAlias;

/**
 *
 * @author Gonzalez
 */
@XStreamAlias("Item")
public class Item implements Comparable<Item> {

    private String name;
    private Category category;
    private double price;
    private int count;

    public Item(String name, Category category) {
        this(name, category, 0, 0);
    }

    public Item(String name, Category category, double price) {
        this(name, category, price, 0);
    }

    public Item(String name, Category category, double price, int count) {
        this.name = name;
        this.category = category;
        this.price = price;
        this.count = count;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    @Override
    public int compareTo(Item o) {
        return this.name.compareTo(o.getName());
    }
}
